﻿using NUnit.Framework;
using PoliticalClassifier.Domain;
using PoliticalClassifier.Support;
using System.Drawing;

namespace PoliticalClassifier.Framework.Test
{
    [TestFixture]
    public class CandidateManagerTest
    {
        [Test]
        public void CandidateManagerAddRemoveTest()
        {
            ICandidateManager manager = new CandidateManager();

            ICandidate candidate1 = new Candidate();
            candidate1.Name = "Test1";
            candidate1.Color = Color.Blue;
            candidate1.Location = new Point2D(100.00, 20.20);

            Assert.AreEqual(0, manager.Count);
            manager.AddCandidate(candidate1);
            Assert.AreEqual(1, manager.Count);


            ICandidate candidate2 = new Candidate();
            candidate2.Name = "Test2";
            candidate2.Color = Color.Blue;
            candidate2.Location = new Point2D(200.00, 30.30);

            manager.AddCandidate(candidate2);
            Assert.AreEqual(2, manager.Count);

            manager.RemoveCandidate(0);
            Assert.AreEqual(1, manager.Count);

            manager.RemoveCandidate(0);
            Assert.AreEqual(0, manager.Count);
        }
    }
}
